// import Cookies from 'js-cookie'

// const TokenKey = 'vue_admin_template_token'

export function getToken (name) {
  let ss_userInfo = sessionStorage.getItem('ss_userInfo')
  if (ss_userInfo) {
    return JSON.parse(sessionStorage.getItem('ss_userInfo'))[name] || '';
  }
}

export function setToken (name, val) {
  sessionStorage.setItem(name, val);
  sessionStorage.removeItem('ss_userInfo');
  sessionStorage && sessionStorage.setItem('ss_userInfo', JSON.stringify(sessionStorage));
}

export function removeToken (name) {
  sessionStorage.removeItem(name);
  sessionStorage.removeItem('ss_userInfo');
  sessionStorage && sessionStorage.setItem('ss_userInfo', JSON.stringify(sessionStorage));
}
